home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr42
/
vocshow2.zip
/
VOC_SHOW.PKG
< prev
Wrap
Text File
|
1993-06-08
|
2KB
|
70 lines
-- Copyright 1992 by Tom Moran. May be used by anyone for any purpose.
with Command_Line,
Text_Io,
Voc_Data,
Voc_Io,
Voc_Pc;
procedure Voc_Show is
package Packing_Io is new Text_Io.Enumeration_Io(Voc_Data.Pack_Types);
package Duration_Io is new Text_Io.Fixed_Io(Duration);
F : Voc_Io.Handles;
type Handle_Block_Results is (Finished, More_To_Come);
function Handle_Block return Handle_Block_Results is
B : Voc_Data.Blocks;
begin
Voc_Io.Read(F, B);
Text_Io.New_Line;
case B.Block_Type is
when Voc_Data.Terminator =>
return Finished;
when Voc_Data.Voice_Data =>
Text_Io.Put("sound "
& Integer'Image(B.Block_Length)
& " bytes @"
& Integer'Image(Integer(B.Sample_Rate))
& " samples/sec ");
Packing_Io.Put(B.Packing);
Voc_Pc.Play(B);
when Voc_Data.Silence =>
Text_Io.Put("silence ");
Duration_Io.Put(B.Silence_Interval);
Text_Io.Put(" seconds");
Voc_Pc.Play(B);
when Voc_Data.Marker =>
Text_Io.Put("marker=" & Integer'Image(Integer(B.Mark)));
when Voc_Data.Text =>
Text_Io.Put(B.Text_String);
when Voc_Data.Start_Repeat =>
Text_Io.Put("start repeat " & Integer'Image(Integer(B.Count)));
when Voc_Data.End_Repeat =>
Text_Io.Put("end repeat");
when Voc_Data.Voice_Continuation =>
Text_Io.Put("voice_continuation"); -- should never happen!
end case;
return More_To_Come;
end Handle_Block;
begin
if Command_Line.Parameter_Count /= 1 then
Text_Io.Put("usage:" & Command_Line.Parameter(0) & " filename");
else
Voc_Io.Open(Command_Line.Parameter(1), F);
loop
exit when Handle_Block = Finished;
end loop;
Voc_Io.Close(F);
end if;
exception
when Voc_Io.Name_Error =>
Text_Io.Put("Sorry, can't find file " & Command_Line.Parameter(1));
end Voc_Show;